package cn.edu.nwsuaf.examcenter.model;

import java.util.List;

import org.springframework.stereotype.Repository;

/****
 * @category 分页Model
 * @author Fantacy
 *
 * @param <T>
 */
public class PageModel<T> {
	private String keyword;
	private int rows = 10;
	private int totalrows;
	private int totalpages;
	private int currentpage;
	private List<T> list;
	
	public int getRows(){
		return this.rows;
	}
	public String getKeyword() {
		return keyword;
	}
	public void setKeyword(String keyword) {
		this.keyword = keyword;
	}
	public int getTotalrows() {
		return totalrows;
	}
	public void setTotalrows(int totalrows) {
		this.totalrows = totalrows;
		if(this.totalrows % rows == 0){
			this.totalpages = this.totalrows / this.rows;
		}else{
			this.totalpages = this.totalrows==0?1:(this.totalrows/this.rows+1);
		}
	}
	public int getTotalpages() {
		return totalpages;
	}
	public void setTotalpages(int totalpages) {
		this.totalpages = totalpages;
	}
	public int getCurrentpage() {
		return currentpage;
	}
	public void setCurrentpage(int currentpage) {
		this.currentpage = currentpage;
	}
	public List<T> getList() {
		return list;
	}
	public void setList(List<T> list) {
		this.list = list;
	}
}
